package com.treasure.mall.biz.service.core.app.impl;

import com.treasure.mall.biz.entity.common.AppCheckUpdate;
import com.treasure.mall.biz.repository.common.AppCheckUpdateRepository;
import com.treasure.mall.biz.service.core.app.AppCheckUpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.service.core.app.impl
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/7/11 16:50
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.service.core.app.impl Inc. All rights reserved.
 */
@Service
public class AppCheckUpdateServiceImpl implements AppCheckUpdateService {

    @Autowired
    private AppCheckUpdateRepository repository;

    @Override
    public AppCheckUpdate checkUpdate() {
        AppCheckUpdate appCheckUpdate = repository.findFirstByAppType(1);
        if (appCheckUpdate == null) {
            appCheckUpdate = new AppCheckUpdate();
            appCheckUpdate.setCode(0);
        }
        return appCheckUpdate;
    }
}
